﻿Public Class oiml

    'Public Shared dbConn As String = "Integrated Security=SSPI;Persist Security Info=False;User ID=sa;Data Source=DGO-PC\SQLEXPRESS;Initial catalog=SistemaRC"
    Public Shared dbConn As String = Global.SistemaRC.My.MySettings.Default.RCBDconexion
    '"Integrated Security=SSPI;Persist Security Info=False;User ID=sa;Data Source=localhost\SQLExpress;Initial catalog=SistemaRCV2"

    'System.Configuration.ConfigurationManager.AppSettings("dbConn")
    Public Shared idUsuario As Integer = 0
    Public Shared Usuario As String = "Admin"

    Public Shared codEstadoCierreNota As Integer = 6
    Public Shared codEstadoProduccionNota As Integer = 2
    Public Shared codEstadoAnulaNota As Integer = 11

    Public Shared Function ControlPermiso(idUsuario As Integer, Funcion As String) As Boolean
        Dim usu As New Class_RC_Controller.rc_Mantenimiento()
        If usu.controlAccesosPermisos(dbConn, idUsuario, Funcion) Then
            Return True
        Else
            Return False
        End If
    End Function

    Public Shared Sub Log(idUsuario As Integer, logDescrip As String, idFuncion As Integer, Optional dt As DataTable = Nothing)
        Dim log__1 As New Class_RC_Controller.rc_Mantenimiento()

        If log__1.Insert_Log(oiml.dbConn, logDescrip, idUsuario, idFuncion, dt) = 0 Then

            MessageBox.Show("Error: " & log__1.MessageError.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error)

            End
            If True Then

            End If
        End If

    End Sub


End Class
